package com.atguigu.gmall.common.config.threadpool;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2024/9/14 23:50
 */
@ConfigurationProperties(prefix = "app.thread")
@Data
public class AppTreadPoolProperties {
//    int corePoolSize,
//    int maximumPoolSize,
//    long keepAliveTime,
//    TimeUnit unit,
//    BlockingQueue<Runnable> workQueue,
//    ThreadFactory
//    RejectedExecutionHandler handler
    private int corePoolSize;
    private int maximumPoolSize;

    private long keepAliveTime;

    private TimeUnit unit=TimeUnit.MINUTES;
    private int queueSize;

    private RejectedExecutionHandler rejectedHander= new ThreadPoolExecutor.CallerRunsPolicy();

}
